package com.example.ws.config;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**
 * Websocket注解式配置
 */
@Configuration
@EnableWebSocket
public class WebSocketConfig {
    // 创建一个ServerEndpointExporter的Bean
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        // 返回一个新的ServerEndpointExporter对象
        return new ServerEndpointExporter();
    }
}